Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/23 validate raw params #27

Merged
merged 13 commits into from
Aug 7, 2024
Merged

Conversation

AlexAxthelm
Copy link
Collaborator

@AlexAxthelm AlexAxthelm commented Aug 1, 2024

Closes #23

Provides a unified interface for parsing and validating JSON params, including raw-schema validation (checking that params are either valid, or contain an appropriate inherit key)

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.79%. Comparing base (512e154) to head (fc021cc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #27      +/-   ##
==========================================
+ Coverage   97.65%   97.79%   +0.13%     
==========================================
  Files           7        8       +1     
  Lines         511      543      +32     
==========================================
+ Hits          499      531      +32     
  Misses         12       12              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AlexAxthelm AlexAxthelm marked this pull request as ready for review August 6, 2024 14:02
@AlexAxthelm AlexAxthelm self-assigned this Aug 6, 2024
@cjyetman cjyetman removed their request for review August 6, 2024 14:03
Copy link
Member

@jdhoffa jdhoffa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is an exported function, it's good to ensure the input args are well documented (NIT: ideally with an example). Otherwise this looks good! Tests explain the behaviour quite well.

Just for my understanding, when you specify "raw" here, you mean a JSON that may not exactly fit the final expected JSON input (e.g. may need to expand some inherit rules to get to that point)?

And then parse_params expected an input JSON that explicitly has all of the necessary keys?

Comment on lines 6 to 10
#' @param json JSON string
#' @param inheritence_search_paths value
#' @param schema_file value
#' @param raw_schema_file value
#' @return returndes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add better documentation here

jdhoffa
jdhoffa previously approved these changes Aug 7, 2024
Copy link
Member

@jdhoffa jdhoffa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: lintr failures, but otherwise LGTM

@AlexAxthelm AlexAxthelm merged commit bd101dd into main Aug 7, 2024
20 checks passed
@AlexAxthelm AlexAxthelm deleted the feat/23-validate-raw-params branch August 7, 2024 15:16
AlexAxthelm added a commit to RMI-PACTA/workflow.pacta that referenced this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add parameter parsing function to parse raw parameters
2 participants